<!DOCTYPE html>
<html>
<head>
	<base href="http://localhost:8576/">
	<meta charset="utf-8">
	<meta name="author" content="Kodinger">
	<title>后台系统登录</title>
	<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/my-login.css">
</head>
<body class="my-login-page">
	<section class="h-100">
		<div class="container h-100">
			<div class="row justify-content-md-center h-100">
				<div class="card-wrapper">
					<div class="brand">
						<img src="img/logo.jpg">
					</div>
					<div class="card fat">
						<div class="card-body">
							<h4 class="card-title">后台登录</h4>
							<form id="loginForm" method="POST" action="back/login">
							 
								<div class="form-group">
									<label for="username">用户名</label>

									<input id="username" type="text" class="form-control" name="username" value="" required autofocus>
								</div>

								<div class="form-group">
									<label for="password">密码
										<a href="forgot.html" class="float-right">
											忘记密码？
										</a>
									</label>
									<input id="password" type="password" class="form-control" name="password" required data-eye>
								</div>

								<!--<div class="form-group">-->
									<!--<label>-->
										<!--<input type="checkbox" name="remember"> Remember Me-->
									<!--</label>-->
								<!--</div>-->

								<div class="form-group no-margin">
									<button type="button" onclick="submitUser()" class="btn btn-primary btn-block">
										登录
									</button>
								</div>
								<div class="margin-top20 text-center">
									没有账号？ <a href="register.html">注册</a>
								</div>
							</form>
						</div>
					</div>

				</div>
			</div>
		</div>
	</section>

	<script src="js/jquery.min.js"></script>
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<script src="js/my-login.js"></script>
	<script type="text/javascript">
		function submitUser() {
		    var username = $("#username").val();
		    var password = $("#password").val();
		    var isUsername = false;
		    var isPassword = false;
		    if (username !=null && username!=undefined && username!=''){
		        //alert("用户名不能为空！")
		        isUsername = true;
			}
            if (password !=null && password!=undefined && password!=''){
		        //alert("密码不能为空！")
                isPassword = true;
            }
            if (isUsername&&isPassword){
                $("#loginForm").submit();
			}else {
                alert("用户名和密码不能为空");
			}

        }
	</script>
</body>
</html>